using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.ICM
{
	[DataContract, Table("IcmPurchaseRequest")]
    public class PurchaseRequest
    {
        public PurchaseRequest()
        {
        }
    
		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "PrId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public int PrId { get; set; }

		[DataMember, Display(Name = "PrRefNo", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public string Code { get; set; }

		[DataMember, Display(Name = "PrName", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public string Name { get; set; }

		[DataMember, Display(Name = "PrReason", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public string Reason { get; set; }

		[DataMember, Display(Name = "PrRemark", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public string Remark { get; set; }

        [ForeignKey("MasPurchaseRegular")]
		[DataMember, Display(Name = "PcRuleId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> RegularId { get; set; }

        [ForeignKey("Priority")]
        [DataMember, Display(Name = "PprTypeId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> PriorityId { get; set; }

        [ForeignKey("MasPurchaseType")]
		[DataMember, Display(Name = "PcTypeId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> PcTypeId { get; set; }

        [ForeignKey("MasPurchaseMethod")]
		[DataMember, Display(Name = "PcMethodId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> PcMethodId { get; set; }

		[DataMember, Display(Name = "PcMethodReason", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public string PcMethodReason { get; set; }

		[ForeignKey("YearType")]
		[DataMember, Display(Name = "YearTypeId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> YearTypeId { get; set; }

		[DataMember, Display(Name = "BgmYear", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> BgYear { get; set; }

		[DataMember, Display(Name = "PurchaseDate", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<System.DateTime> PurchaseDate { get; set; }

		[ForeignKey("PurchaseEmp")]
		[DataMember, Display(Name = "PurchaseEmpId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> PurchaseEmpId { get; set; }

		[ForeignKey("PurchaseJobSite")]
		[DataMember, Display(Name = "PurchaseJobSiteId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> PurchaseJobSiteId { get; set; }

		[DataMember, Display(Name = "ConfirmDate", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<System.DateTime> ConfirmDate { get; set; }

		[ForeignKey("ConfirmEmp")]
		[DataMember, Display(Name = "ConfirmEmpId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> ConfirmEmpId { get; set; }

		[DataMember, Display(Name = "CancelDate", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<System.DateTime> CancelDate { get; set; }

		[ForeignKey("CancelEmp")]
		[DataMember, Display(Name = "CancelEmpId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> CancelEmpId { get; set; }

		[DataMember, Display(Name = "RequireDate", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<System.DateTime> RequireDate { get; set; }

		[DataMember, Display(Name = "RequireDuration", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> RequireDuration { get; set; }

        [ForeignKey("DurationType")]
		[DataMember, Display(Name = "DurTypeId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> DurTypeId { get; set; }

        [ForeignKey("DurationCount")]
		[DataMember, Display(Name = "DurCountId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> DurCountId { get; set; }

        [ForeignKey("Progress")]
		[DataMember, Display(Name = "ProgId", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> ProgressId { get; set; }

		[DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public string RecordStatus { get; set; }

		[DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> CreatedBy { get; set; }

		[DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

		[DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<int> UpdatedBy { get; set; }

		[DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.PurchaseRequestResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

	    [DataMember]
	    public int? CommitteeGroupId { get; set; }

        [DataMember]
	    public CommitteeGroup CommitteeGroup { get; set; }

        [DataMember]
        public virtual MasPurchaseRegular MasPurchaseRegular { get; set; }

        [DataMember]
        public virtual MasPurchaseType MasPurchaseType { get; set; }

        [DataMember]
        public virtual MasPurchaseMethod MasPurchaseMethod { get; set; }

        [DataMember]
		public virtual SYS.YearType YearType { get; set; }

        [DataMember]
		public virtual HRM.Employee PurchaseEmp { get; set; }

        [DataMember]
		public virtual HRM.JobSite PurchaseJobSite { get; set; }

        [DataMember]
		public virtual HRM.Employee ConfirmEmp { get; set; }

        [DataMember]
		public virtual HRM.Employee CancelEmp { get; set; }

        [DataMember]
        public virtual IcmMasLookUp Priority { get; set; }

        [DataMember]
        public virtual IcmMasLookUp DurationType { get; set; }

        [DataMember]
        public virtual IcmMasLookUp DurationCount { get; set; }

        [DataMember]
        public virtual IcmMasLookUp Progress { get; set; }

    }
}